package com.eve.springcloud.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * Hystrix测试 20200512
 * @author HXL
 *
 */
@Component
@FeignClient(value = "CLOUD-HYSTRIX-SERVICE", fallback = HystrixFallBackService.class)  // 对外提供的微服务名称（同Eureka上面的）
public interface FeignHystrixService {

	// 调用服务端提供的接口(返回结果的类型为请求接口的返回类型)
	@GetMapping(value = "/dept/get/{id}")
	String findOne(@PathVariable("id") Long id);
	
	@GetMapping(value = "/dept/timeout/{id}")
	String timeoutTest(@PathVariable("id") Long id);
	
}
